openhab-addons/bundles/org.openhab.binding.ntp
openhab-bot 4f59c5e8b0
New Crowdin updates (#11539)
* New translations powermax.properties (French)

* New translations openhabcloud.properties (German)

* New translations avmfritz.properties (German)

* New translations mail.properties (German)

* New translations hue.properties (German)

* New translations airquality.properties (French)

* New translations ntp.properties (German)

* New translations velux.properties (German)

* New translations mail.properties (German)

* New translations hue.properties (German)

* New translations avmfritz.properties (German)

* New translations pixometer.properties (German)

* New translations openuv.properties (French)
2021-11-11 13:26:04 +01:00
..
src/main New Crowdin updates (#11539) 2021-11-11 13:26:04 +01:00
NOTICE added migrated 2.x add-ons 2020-09-21 03:37:19 +02:00
pom.xml applied spotless 2021-06-27 23:25:35 +02:00
README.md added migrated 2.x add-ons 2020-09-21 03:37:19 +02:00

NTP Binding

The NTP binding is used for displaying the local date and time based update from an NTP server.

Supported Things

This binding supports one ThingType: ntp

Discovery

Discovery is used to place one default item in the inbox as a convenient way to add a Thing for the local time.

Binding Configuration

The binding has no configuration options, all configuration is done at Thing level.

Thing Configuration

The thing has a few configuration options:

Option Description
hostname The NTP server hostname, e.g. nl.pool.ntp.org
refreshInterval Interval that new time updates are posted to the eventbus in seconds. Default is 60s.
refreshNtp Number of updates between querying the NTP server (e.g. with refreshinterval = 60 (seconds) and refreshNtp = 30 the NTP server is queried each half hour). Default is 30.
serverPort The port that the NTP server could use. Default is 123.
timeZone The configured timezone. Can be left blank for using the timezone defined as openHAB configuration setting (or default system timezone if not defined).

Channels

The ntp binding has two channels:

  • dateTime which provides the data in a dateTime type
  • string which provides the data in a string type. The string channel can be configured with the formatting of the date & time. This also allows proper representation of timezones other than the java machine default one.

See the java documentation for the detailed information on the formatting

Full Example

Things:

ntp:ntp:demo  [ hostname="nl.pool.ntp.org", refreshInterval=60, refreshNtp=30 ]

Items:

DateTime Date  "Date [%1$tA, %1$td.%1$tm.%1$tY %1$tH:%1$tM]"  { channel="ntp:ntp:demo:dateTime" }