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

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

Usage

The remote switch Bricklet functions as bridge for remote controlled mains switches and dimmers. Switches/dimmers must be added as things to openHAB manually with the Paper UI. The switch/dimmer thing can then be configured depending on the addressing type. (See hardware documentation)

Thing

UID:
  • tinkerforge:brickletremoteswitch:[UID]
Required firmware version:
  • 2.0.1
Firmware update supported:
  • yes
Channels:
Actions:

Channels

Switching Done

This channel is triggered whenever the switching state changes from busy to ready.

Type:
  • Trigger (system.trigger)
UID:
  • tinkerforge:brickletremoteswitch:[UID]:BrickletRemoteSwitchSwitchingDone
Read only:
  • No

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

Basic Actions

brickletRemoteSwitchGetSwitchingState()
Return Map:
  • state – Type: short, Range: See constants

Returns the current switching state. If the current state is busy, the Bricklet is currently sending a code to switch a socket. It will not accept any requests to switch sockets until the state changes to ready.

How long the switching takes is dependent on the number of repeats, see SetRepeats().

The following constants are available for this function:

For state:

  • val SWITCHING_STATE_READY = 0
  • val SWITCHING_STATE_BUSY = 1
brickletRemoteSwitchSwitchSocketA(short houseCode, short receiverCode, short switchTo)
Parameters:
  • houseCode – Type: short, Range: [0 to 31]
  • receiverCode – Type: short, Range: [0 to 31]
  • switchTo – Type: short, Range: See constants

To switch a type A socket you have to give the house code, receiver code and the state (on or off) you want to switch to.

A detailed description on how you can figure out the house and receiver code can be found here.

The following constants are available for this function:

For switchTo:

  • val SWITCH_TO_OFF = 0
  • val SWITCH_TO_ON = 1

New in version 2.0.1 (Plugin).

brickletRemoteSwitchSwitchSocketB(long address, short unit, short switchTo)
Parameters:
  • address – Type: long, Range: [0 to 226 - 1]
  • unit – Type: short, Range: [0 to 15, 255]
  • switchTo – Type: short, Range: See constants

To switch a type B socket you have to give the address, unit and the state (on or off) you want to switch to.

To switch all devices with the same address use 255 for the unit.

A detailed description on how you can teach a socket the address and unit can be found here.

The following constants are available for this function:

For switchTo:

  • val SWITCH_TO_OFF = 0
  • val SWITCH_TO_ON = 1

New in version 2.0.1 (Plugin).

brickletRemoteSwitchDimSocketB(long address, short unit, short dimValue)
Parameters:
  • address – Type: long, Range: [0 to 226 - 1]
  • unit – Type: short, Range: [0 to 15, 255]
  • dimValue – Type: short, Range: [0 to 255]

To control a type B dimmer you have to give the address, unit and the dim value you want to set the dimmer to.

A detailed description on how you can teach a dimmer the address and unit can be found here.

New in version 2.0.1 (Plugin).

brickletRemoteSwitchSwitchSocketC(char systemCode, short deviceCode, short switchTo)
Parameters:
  • systemCode – Type: char, Range: ['A' to 'P']
  • deviceCode – Type: short, Range: [1 to 16]
  • switchTo – Type: short, Range: See constants

To switch a type C socket you have to give the system code, device code and the state (on or off) you want to switch to.

A detailed description on how you can figure out the system and device code can be found here.

The following constants are available for this function:

For switchTo:

  • val SWITCH_TO_OFF = 0
  • val SWITCH_TO_ON = 1

New in version 2.0.1 (Plugin).

Advanced Actions

brickletRemoteSwitchSetRepeats(short repeats)
Parameters:
  • repeats – Type: short, Range: [0 to 255], Default: 5

Sets the number of times the code is sent when one of the switch socket functions is called. The repeats basically correspond to the amount of time that a button of the remote is pressed.

Some dimmers are controlled by the length of a button pressed, this can be simulated by increasing the repeats.

brickletRemoteSwitchGetRepeats()
Return Map:
  • repeats – Type: short, Range: [0 to 255], Default: 5

Returns the number of repeats as set by SetRepeats().

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