Bemerkung
Die openHAB-Dokumentation ist nur auf Englisch verfügbar.
Warnung
The openHAB bindings are still in beta, but the development was stopped.
This is the description of the openHAB API bindings for the Real-Time Clock Bricklet. General information and technical specifications for the Real-Time Clock Bricklet are summarized in its hardware description.
An installation guide for the openHAB API bindings is part of their general description.
UID:
- tinkerforge:brickletrealtimeclock:[UID]
Required firmware version:
- 2.0.1
Firmware update supported:
- yes
Channels: Actions: Parameters:
- Date Time Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
- Specifies the update interval for the date time and timestamp in milliseconds. A value of 0 disables automatic updates.
Date Time
¶The real-time clock handles leap year and inserts the 29th of February accordingly. But leap seconds are not handled. The time is stored as UTC on the clock and converted into your system's timezone when accessed by OpenHAB.
Type:
- DateTime
UID:
- tinkerforge:brickletrealtimeclock:[UID]:BrickletRealTimeClockDateTime
Read only:
- No
Timestamp
¶the current date and the time of the real-time clock converted to seconds. The timestamp has an effective resolution of hundredths of a second.
Type:
- Number:Time
UID:
- tinkerforge:brickletrealtimeclock:[UID]:BrickletRealTimeClockTimestamp
Read only:
- Yes
Unit:
- Second
Alarm
¶This listener is triggered every time the current date and time matches the configured alarm (see the setAlarm action).
Type:
- Trigger (system.trigger)
UID:
- tinkerforge:brickletrealtimeclock:[UID]:BrickletRealTimeClockAlarm
Read only:
- No
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:brickletrealtimeclock:[UID]")
val hwVersion = actions.brickletRealTimeClockGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))
brickletRealTimeClockSetDateTime
(int year, short month, short day, short hour, short minute, short second, short centisecond, short weekday)¶Parameters: |
|
---|
Sets the current date (including weekday) and the current time.
If the backup battery is installed then the real-time clock keeps date and time even if the Bricklet is not powered by a Brick.
The real-time clock handles leap year and inserts the 29th of February accordingly. But leap seconds, time zones and daylight saving time are not handled.
The following constants are available for this function:
For weekday:
brickletRealTimeClockGetDateTime
()¶Return Map: |
|
---|
Returns the current date (including weekday) and the current time of the real-time clock.
The following constants are available for this function:
For weekday:
brickletRealTimeClockGetTimestamp
()¶Return Map: |
|
---|
Returns the current date and the time of the real-time clock. The timestamp has an effective resolution of hundredths of a second and is an offset to 2000-01-01 00:00:00.000.
brickletRealTimeClockGetOffset
()¶Return Map: |
|
---|
Returns the offset as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickletRealTimeClockGetIdentity
()¶Return Map: |
|
---|
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.
brickletRealTimeClockSetAlarm
(byte month, byte day, byte hour, byte minute, byte second, byte weekday, int interval)¶Parameters: |
|
---|
Configures a repeatable alarm. The Alarm
channel is triggered if the
current date and time matches the configured alarm.
Setting a parameter to -1 means that it should be disabled and doesn't take part in the match. Setting all parameters to -1 disables the alarm completely.
For example, to make the alarm trigger every day at 7:30 AM it can be configured as (-1, -1, 7, 30, -1, -1, -1). The hour is set to match 7 and the minute is set to match 30. The alarm is triggered if all enabled parameters match.
The interval has a special role. It allows to make the alarm reconfigure itself. This is useful if you need a repeated alarm that cannot be expressed by matching the current date and time. For example, to make the alarm trigger every 23 seconds it can be configured as (-1, -1, -1, -1, -1, -1, 23). Internally the Bricklet will take the current date and time, add 23 seconds to it and set the result as its alarm. The first alarm will be triggered 23 seconds after the call. Because the interval is not -1, the Bricklet will do the same again internally, take the current date and time, add 23 seconds to it and set that as its alarm. This results in a repeated alarm that triggers every 23 seconds.
The interval can also be used in combination with the other parameters. For example, configuring the alarm as (-1, -1, 7, 30, -1, -1, 300) results in an alarm that triggers every day at 7:30 AM and is then repeated every 5 minutes.
The following constants are available for this function:
For month:
For day:
For hour:
For minute:
For second:
For weekday:
For interval:
Neu in Version 2.0.1 (Plugin).
brickletRealTimeClockGetAlarm
()¶Return Map: |
|
---|
Returns the alarm configuration as set by SetAlarm()
.
The following constants are available for this function:
For month:
For day:
For hour:
For minute:
For second:
For weekday:
For interval:
Neu in Version 2.0.1 (Plugin).