Here’s a tutorial on how to achieve your local language for the NTP binding.
No hassle with installing another locale on your Raspberry or other system.
Just keeping the settings of your system. It’s just a few simple steps…
Step 1 - Install the NTP Binding in OpenHab
Step 2 - Go to Things -> Local Time and link the channel “ntp:ntp:local:dateTime” to an item “Date”
(this item you can use in the future for a full date & time text. Example: Sunday, 06.01.2019 20:00)
Step 3 - Create a file called ‘weekday.map’ and put this in the folder ‘\OPENHABIANPI\openHAB-conf\transform’
In this file put the English weekdays and your own language for translation. Example:
Sunday=Zondag
Monday=Maandag
Tuesday=Dinsdag
Wednesday=Woensdag
Thursday=Donderdag
Friday=Vrijdag
Saturday=Zaterdag
Step 4 - Put this line in the home.things file. Change it to your own locale / ntp server if needed.
ntp:ntp:local [ hostname="nl.pool.ntp.org", refreshInterval=60, refreshNtp=30, locale="Europe/Amsterdam" timeZone="Europe/Amsterdam" ]
Step 5 - Create 2 new items by adding these lines in the home.items file.
DateTime Today "Datum [MAP(weekday.map):%1$tA]" { channel="ntp:ntp:local:dateTime" }
DateTime Time "[%1$td.%1$tm.%1$tY %1$tH:%1$tM]" { channel="ntp:ntp:local:dateTime" }
Step 6 - You can now add the items to your sitemap by adding these lines to the home.sitemap file.
Text label="" icon="calendar" item=Today
Text label="" icon="" item=Time