Warning
The openHAB bindings are still in beta, but the development was stopped.
This is the description of the openHAB API bindings for the Master Brick. General information and technical specifications for the Master Brick are summarized in its hardware description.
An installation guide for the openHAB API bindings is part of their general description.
UID:
- tinkerforge:brickmaster:[UID]
Required firmware version:
- 2.4.2
Firmware update supported:
- no
Channels: Actions:
- GetStackVoltage
- GetStackCurrent
- GetExtensionType
- IsChibiPresent
- GetChibiAddress
- GetChibiMasterAddress
- GetChibiSlaveAddress
- GetChibiSignalStrength
- GetChibiErrorLog
- GetChibiFrequency
- GetChibiChannel
- IsRS485Present
- GetRS485Address
- GetRS485SlaveAddress
- GetRS485ErrorLog
- GetRS485Configuration
- IsWifiPresent
- GetWifiConfiguration
- GetWifiEncryption
- GetWifiStatus
- RefreshWifiStatus
- GetWifiCertificate
- GetWifiPowerMode
- GetWifiBufferInfo
- GetWifiRegulatoryDomain
- GetLongWifiKey
- GetWifiHostname
- GetWifiAuthenticationSecret
- GetUSBVoltage
- IsEthernetPresent
- GetEthernetConfiguration
- GetEthernetStatus
- GetEthernetWebsocketConfiguration
- GetEthernetAuthenticationSecret
- GetConnectionType
- IsWifi2Present
- GetWifi2AuthenticationSecret
- GetWifi2Configuration
- GetWifi2Status
- GetWifi2ClientConfiguration
- GetWifi2ClientHostname
- GetWifi2APConfiguration
- GetWifi2FirmwareVersion
- EnableWifi2StatusLED
- DisableWifi2StatusLED
- IsWifi2StatusLEDEnabled
- GetWifi2MeshConfiguration
- GetWifi2MeshRouterSSID
- GetWifi2MeshCommonStatus
- GetWifi2MeshClientStatus
- GetWifi2MeshAPStatus
- SetBrickletsEnabled
- GetBrickletsEnabled
- GetIdentity
- IsStatusLEDEnabled
- GetChipTemperature
- GetSendTimeoutCount
- GetSPITFPBaudrateConfig
- GetSPITFPErrorCount
- GetSPITFPBaudrate
Parameters:
- Status LED Configuration – Type: boolean, Default: true
- The status LED is the blue LED next to the USB connector. If enabled is is on and it flickers if data is transfered. If disabled it is always off.
- SPITFP Enable Dynamic Baudrate – Type: boolean, Default: true
- The SPITF protocol can be used with a dynamic baudrate. If the dynamic baudrate is enabled, the Brick will try to adapt the baudrate for the communication between Bricks and Bricklets according to the amount of data that is transferred. The baudrate will be increased exponentially if lots of data is sent/received and decreased linearly if little data is sent/received. This lowers the baudrate in applications where little data is transferred (e.g. a weather station) and increases the robustness. If there is lots of data to transfer (e.g. Thermal Imaging Bricklet) it automatically increases the baudrate as needed. In cases where some data has to transferred as fast as possible every few seconds (e.g. RS485 Bricklet with a high baudrate but small payload) you may want to turn the dynamic baudrate off to get the highest possible performance. The maximum value of the baudrate can be set per port. If the dynamic baudrate is disabled, the maximum baudrate will be used statically.
- SPITFP Minimum Dynamic Baudrate – Type: integer, Default: 400000, Min: 400000, Max: 2000000
- See SPITFP Enable Dynamic Baudrate
- (Maximum) SPITFP Baudrate Port A – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
- The baudrate for Bricklet port A. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in your applications we recommend to not change the baudrate.
- (Maximum) SPITFP Baudrate Port B – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
- The baudrate for Bricklet port B. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in your applications we recommend to not change the baudrate.
- (Maximum) SPITFP Baudrate Port C – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
- The baudrate for Bricklet port C. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in your applications we recommend to not change the baudrate.
- (Maximum) SPITFP Baudrate Port D – Type: integer, Default: 1400000, Min: 400000, Max: 2000000
- The baudrate for Bricklet port D. If you want to increase the throughput of Bricklets you can increase the baudrate. If you get a high error count because of high interference you can decrease the baudrate. If the dynamic baudrate feature is enabled, this is the maximum baudrate. Regulatory testing is done with the default baudrate. If CE compatibility or similar is necessary in your applications we recommend to not change the baudrate.
Stack Voltage
¶The stack voltage in V. The stack voltage is the voltage that is supplied via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.
Type:
- Number:ElectricPotential
UID:
- tinkerforge:brickmaster:[UID]:BrickMasterStackVoltage
Read only:
- Yes
Unit:
- Volt
Parameters:
- Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
- Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
USB Voltage
¶The USB voltage in V.
Type:
- Number:ElectricPotential
UID:
- tinkerforge:brickmaster:[UID]:BrickMasterUSBVoltage
Read only:
- Yes
Predicate:
- This channel will only be available if the Brick has a hardware version less than 2.1.0.
Unit:
- Volt
Parameters:
- Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
- Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Stack Current
¶The stack current in A. The stack current is the current that is drawn via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.
Type:
- Number:ElectricCurrent
UID:
- tinkerforge:brickmaster:[UID]:BrickMasterStackCurrent
Read only:
- Yes
Unit:
- Ampere
Parameters:
- Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
- Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Bricklets Enabled
¶Enables/disables all four Bricklets. If you disable the Bricklets the power supply to the Bricklets will be disconnected.
Type:
- Switch
UID:
- tinkerforge:brickmaster:[UID]:BrickMasterBrickletsEnabled
Read only:
- No
Predicate:
- This channel will only be available if the Brick has a hardware version of at least 3.0.0.
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:brickmaster:[UID]")
val hwVersion = actions.brickMasterGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))
brickMasterGetStackVoltage
()¶Return Map: |
|
---|
Returns the stack voltage. The stack voltage is the voltage that is supplied via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.
Note
It is not possible to measure voltages supplied per PoE or USB with this function.
brickMasterGetStackCurrent
()¶Return Map: |
|
---|
Returns the stack current. The stack current is the current that is drawn via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply.
Note
It is not possible to measure the current drawn via PoE or USB with this function.
brickMasterGetExtensionType
(short extension)¶Parameters: |
|
---|---|
Return Map: |
|
Returns the type for a given extension as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For exttype:
brickMasterIsChibiPresent
()¶Return Map: |
|
---|
Returns true if the Master Brick is at position 0 in the stack and a Chibi Extension is available.
brickMasterGetChibiAddress
()¶Return Map: |
|
---|
Returns the address as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickMasterGetChibiMasterAddress
()¶Return Map: |
|
---|
Returns the address as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickMasterGetChibiSlaveAddress
(short num)¶Parameters: |
|
---|---|
Return Map: |
|
Returns the slave address for a given num
as set by
This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickMasterGetChibiSignalStrength
()¶Return Map: |
|
---|
Returns the signal strength in dBm. The signal strength updates every time a packet is received.
brickMasterGetChibiErrorLog
()¶Return Map: |
|
---|
Returns underrun, CRC error, no ACK and overflow error counts of the Chibi communication. If these errors start rising, it is likely that either the distance between two Chibi stacks is becoming too big or there are interferences.
brickMasterGetChibiFrequency
()¶Return Map: |
|
---|
Returns the frequency value as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For frequency:
brickMasterGetChibiChannel
()¶Return Map: |
|
---|
Returns the channel as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickMasterIsRS485Present
()¶Return Map: |
|
---|
Returns true if the Master Brick is at position 0 in the stack and a RS485 Extension is available.
brickMasterGetRS485Address
()¶Return Map: |
|
---|
Returns the address as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickMasterGetRS485SlaveAddress
(short num)¶Parameters: |
|
---|---|
Return Map: |
|
Returns the slave address for a given num
as set by
This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickMasterGetRS485ErrorLog
()¶Return Map: |
|
---|
Returns CRC error counts of the RS485 communication. If this counter starts rising, it is likely that the distance between the RS485 nodes is too big or there is some kind of interference.
brickMasterGetRS485Configuration
()¶Return Map: |
|
---|
Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For parity:
brickMasterIsWifiPresent
()¶Return Map: |
|
---|
Returns true if the Master Brick is at position 0 in the stack and a WIFI Extension is available.
brickMasterGetWifiConfiguration
()¶Return Map: |
|
---|
Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For connection:
brickMasterGetWifiEncryption
()¶Return Map: |
|
---|
Returns the encryption as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
Note
Since Master Brick Firmware version 2.4.4 the key is not returned anymore.
The following constants are available for this function:
For encryption:
For eapOptions:
brickMasterGetWifiStatus
()¶Return Map: |
|
---|
Returns the status of the WIFI Extension. The state
is updated automatically,
all of the other parameters are updated on startup and every time
RefreshWifiStatus()
is called.
Possible states are:
State | Description |
---|---|
0 | Disassociated |
1 | Associated |
2 | Associating |
3 | Error |
255 | Not initialized yet |
The following constants are available for this function:
For state:
brickMasterRefreshWifiStatus
()¶Refreshes the Wi-Fi status (see GetWifiStatus()
). To read the status
of the Wi-Fi module, the Master Brick has to change from data mode to
command mode and back. This transaction and the readout itself is
unfortunately time consuming. This means, that it might take some ms
until the stack with attached WIFI Extension reacts again after this
function is called.
brickMasterGetWifiCertificate
(int index)¶Parameters: |
|
---|---|
Return Map: |
|
Returns the certificate for a given index as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickMasterGetWifiPowerMode
()¶Return Map: |
|
---|
Returns the power mode as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For mode:
brickMasterGetWifiBufferInfo
()¶Return Map: |
|
---|
Returns informations about the Wi-Fi receive buffer. The Wi-Fi receive buffer has a max size of 1500 byte and if data is transfered too fast, it might overflow.
The return values are the number of overflows, the low watermark (i.e. the smallest number of bytes that were free in the buffer) and the bytes that are currently used.
You should always try to keep the buffer empty, otherwise you will have a permanent latency. A good rule of thumb is, that you can transfer 1000 messages per second without problems.
Try to not send more then 50 messages at a time without any kind of break between them.
brickMasterGetWifiRegulatoryDomain
()¶Return Map: |
|
---|
Returns the regulatory domain as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For domain:
brickMasterGetLongWifiKey
()¶Return Map: |
|
---|
Returns the encryption key as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
Note
Since Master Brick firmware version 2.4.4 the key is not returned anymore.
New in version 2.0.2 (Firmware).
brickMasterGetWifiHostname
()¶Return Map: |
|
---|
Returns the hostname as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
An empty String means, that the default hostname is used.
New in version 2.0.5 (Firmware).
brickMasterGetWifiAuthenticationSecret
()¶Return Map: |
|
---|
Returns the authentication secret as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.2.0 (Firmware).
brickMasterGetUSBVoltage
()¶Return Map: |
|
---|
Returns the USB voltage. Does not work with hardware version 2.1 or newer.
brickMasterIsEthernetPresent
()¶Return Map: |
|
---|
Returns true if the Master Brick is at position 0 in the stack and an Ethernet Extension is available.
New in version 2.1.0 (Firmware).
brickMasterGetEthernetConfiguration
()¶Return Map: |
|
---|
Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For connection:
New in version 2.1.0 (Firmware).
brickMasterGetEthernetStatus
()¶Return Map: |
|
---|
Returns the status of the Ethernet Extension.
mac_address
, ip
, subnet_mask
and gateway
are given as an array.
The first element of the array is the least significant byte of the address.
rx_count
and tx_count
are the number of bytes that have been
received/send since last restart.
hostname
is the currently used hostname.
New in version 2.1.0 (Firmware).
brickMasterGetEthernetWebsocketConfiguration
()¶Return Map: |
|
---|
Returns the configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.2.0 (Firmware).
brickMasterGetEthernetAuthenticationSecret
()¶Return Map: |
|
---|
Returns the authentication secret as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.2.0 (Firmware).
brickMasterGetConnectionType
()¶Return Map: |
|
---|
Returns the type of the connection over which this function was called.
The following constants are available for this function:
For connectionType:
New in version 2.4.0 (Firmware).
brickMasterIsWifi2Present
()¶Return Map: |
|
---|
Returns true if the Master Brick is at position 0 in the stack and a WIFI Extension 2.0 is available.
New in version 2.4.0 (Firmware).
brickMasterGetWifi2AuthenticationSecret
()¶Return Map: |
|
---|
Returns the WIFI authentication secret as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.4.0 (Firmware).
brickMasterGetWifi2Configuration
()¶Return Map: |
|
---|
Returns the general configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For phyMode:
New in version 2.4.0 (Firmware).
brickMasterGetWifi2Status
()¶Return Map: |
|
---|
Returns the client and access point status of the WIFI Extension 2.0.
The following constants are available for this function:
For clientStatus:
New in version 2.4.0 (Firmware).
brickMasterGetWifi2ClientConfiguration
()¶Return Map: |
|
---|
Returns the client configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.4.0 (Firmware).
brickMasterGetWifi2ClientHostname
()¶Return Map: |
|
---|
Returns the client hostname as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.4.0 (Firmware).
brickMasterGetWifi2APConfiguration
()¶Return Map: |
|
---|
Returns the access point configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
The following constants are available for this function:
For encryption:
New in version 2.4.0 (Firmware).
brickMasterGetWifi2FirmwareVersion
()¶Return Map: |
|
---|
Returns the current version of the WIFI Extension 2.0 firmware.
New in version 2.4.0 (Firmware).
brickMasterEnableWifi2StatusLED
()¶Turns the green status LED of the WIFI Extension 2.0 on.
New in version 2.4.0 (Firmware).
brickMasterDisableWifi2StatusLED
()¶Turns the green status LED of the WIFI Extension 2.0 off.
New in version 2.4.0 (Firmware).
brickMasterIsWifi2StatusLEDEnabled
()¶Return Map: |
|
---|
Returns true if the green status LED of the WIFI Extension 2.0 is turned on.
New in version 2.4.0 (Firmware).
brickMasterGetWifi2MeshConfiguration
()¶Return Map: |
|
---|
Requires WIFI Extension 2.0 firmware 2.1.0.
Returns the mesh configuration as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.4.2 (Firmware).
brickMasterGetWifi2MeshRouterSSID
()¶Return Map: |
|
---|
Requires WIFI Extension 2.0 firmware 2.1.0.
Returns the mesh router SSID as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
New in version 2.4.2 (Firmware).
brickMasterGetWifi2MeshCommonStatus
()¶Return Map: |
|
---|
Requires WIFI Extension 2.0 firmware 2.1.0.
Returns the common mesh status of the WIFI Extension 2.0.
The following constants are available for this function:
For status:
New in version 2.4.2 (Firmware).
brickMasterGetWifi2MeshClientStatus
()¶Return Map: |
|
---|
Requires WIFI Extension 2.0 firmware 2.1.0.
Returns the mesh client status of the WIFI Extension 2.0.
New in version 2.4.2 (Firmware).
brickMasterGetWifi2MeshAPStatus
()¶Return Map: |
|
---|
Requires WIFI Extension 2.0 firmware 2.1.0.
Returns the mesh AP status of the WIFI Extension 2.0.
New in version 2.4.2 (Firmware).
brickMasterGetIdentity
()¶Return Map: |
|
---|
Returns the UID, the UID where the Brick is connected to, the position, the hardware and firmware version as well as the device identifier.
The position is the position in the stack from '0' (bottom) to '8' (top).
The device identifier numbers can be found here.
brickMasterIsStatusLEDEnabled
()¶Return Map: |
|
---|
Returns true if the status LED is enabled, false otherwise.
New in version 2.3.2 (Firmware).
brickMasterGetChipTemperature
()¶Return Map: |
|
---|
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 an accuracy of ±15%. Practically it is only useful as an indicator for temperature changes.
brickMasterGetSendTimeoutCount
(short communicationMethod)¶Parameters: |
|
---|---|
Return Map: |
|
Returns the timeout count for the different communication methods.
The methods 0-2 are available for all Bricks, 3-7 only for Master Bricks.
This function is mostly used for debugging during development, in normal operation the counters should nearly always stay at 0.
The following constants are available for this function:
For communicationMethod:
New in version 2.4.3 (Firmware).
brickMasterGetSPITFPBaudrateConfig
()¶Return Map: |
|
---|
Returns the baudrate config, see the thing configuration.
New in version 2.4.6 (Firmware).
brickMasterGetSPITFPErrorCount
(char brickletPort)¶Parameters: |
|
---|---|
Return Map: |
|
Returns the error count for the communication between Brick and Bricklet.
The errors are divided into
The errors counts are for errors that occur on the Brick side. All Bricklets have a similar function that returns the errors on the Bricklet side.
New in version 2.4.3 (Firmware).
brickMasterGetSPITFPBaudrate
(char brickletPort)¶Parameters: |
|
---|---|
Return Map: |
|
Returns the baudrate for a given Bricklet port, see the thing configuration.
New in version 2.4.3 (Firmware).
brickMasterSetBrickletsEnabled
(boolean brickletsEnabled)¶Parameters: |
|
---|
This function is only available in Master Brick hardware version >= 3.0.
Enables/disables all four Bricklets if set to true/false.
If you disable the Bricklets the power supply to the Bricklets will be disconnected. The Bricklets will lose all configurations if disabled.
New in version 2.5.0 (Firmware).
brickMasterGetBrickletsEnabled
()¶Return Map: |
|
---|
Returns true if the Bricklets are enabled, false otherwise.
New in version 2.5.0 (Firmware).