I am starting slow and have run into a headache. Here is my home.sitemap file
sitemap home label="Lair of Confusion"
{
Frame label="Date" {
Text item=date
}
}
And my home.items file
/* NTP binding item */
DateTime date "Date and Time [%1$tA, %1$td.%1$tm.%1$tY]" <calendar> {ntp="America/Los_Angeles"}
I turned on debug messages and whenever i refresh my openhab browser page i see a couple things that bother me. Firstly I either get one of these two messages
Either this
[DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
or this
[DEBUG] [ore.internal.items.ItemUpdater] - Received update for non-existing item: Item 'date' could not be found in the item registry
The message is dependent on exactly how i format my date item. I tried to include the charset and it gives the second one.
Secondly i get this message constantly no matter what i do:
[.io.net.http.SecureHttpContext] - security is disabled - processing aborted!
and have no idea what security it is talking about…
I cant get the date to dispaly, it just shows -,-.-.- where the date should be displayed.
Here is my ntp binding config
################################ NTP Binding ##########################################
#
# refresh interval in milliseconds (optional, defaults to 900000 [15 minutes])
#ntp:refresh=
# the hostname of the timeserver
ntp:hostname=0.us.pool.ntp.org
It seems that it is able to acquire the time from NTP once when the openhab runtime starts up, but if i modify the text format and save the items file it goes to being the -,-.-.- format.
First i had this DateTime date "Date and Time [%1$tA, %1$td.%1$tm.%1$tY]" <calendar> {ntp="America/Los_Angeles:en_US"}
and it got the time on boot and was formatted correctly, then i changed it to this
DateTime date "Date and Time [%1$tT %1$tA, %1$td.%1$tm.%1$tY]" <calendar> {ntp="America/Los_Angeles:en_US"}
and after i saved and refreshed the browser, it went to the weird format of -,-.-.- then i did a sudo service openhab restart and it got the time in the correct format after i refreshed the browser. But it doesn’t seem to be updating the time, it’s stuck at the local time when i restarted the openhab service. is this an issue with the ntp refresh interval?
Why isnt the date item updating when i update the items file and why isnt the ntp service refreshing the time?
I think the issue was the refresh interval. After changing it in the cfg to refresh ntp binding every 10 seconds it seems to update correctly and when i change the format of the time in the items file, it still goes to the -,-.-.- format, but only until the NTP refresh occurs (every 10 seconds).
Is NTP not supposed to be used as a clock widget? Should i be using something else? I don’t want to make unecessary calls to the ntp server when i can just pull time from the raspberry pi instead. Which is more efficient?
I still have not figured out the security is disabled - processing aborted! message
The problem was caused when you amended your item file. Doing so refreshes the items back to uninitialized/null and therefore it didn’t have a value until the NTP refresh occurred.