Request: Provide option to specify NTP Server to use, stop hard-wiring it to pool.ntp.org

Welcome to Hubitat!

A small UPS for the Hubitat Hub is really a best practice to ensure it can run smoothly through power blips/outages. It does not have a built-in battery backed up RTC, thus it needs to be able to access the Internet to set its clock. Unfortunately, if the Hubitat hub is up and running before your DHCP server and Internet connection is up, it seems to get itself into trouble with respect to automatically correcting its time.

My advice to you is to send your 'feature request' to support@hubitat.com to make sure this issue stays on their list.

I have my Hubitat hub, cable modem, and router all on an APC UPS. This has completely avoided this issue for me. Also, since the hub is really a full computer, running everything locally including a relational database, losing power can result in corruption of its internal database. The hub can usually detect this, and will restore a recent automatic internal database backup. However, if you had added new devices and automations that same day, those changes might be lost as the automatic backup occurs at ~2am each day. Make sure you manually download a Hub database backup after making significant changes.

4 Likes

Yes I saw that in my searches. However the author mentions 'via API call', and it is not clear to a Hubitat noob how to enable this feature, assuming I had a time server on the network, router does not appear to support it, so I have some pi's around, I could do that. But first I must figure out how to enable this feature.

Via an API call in the driver code - no enabling necessary. After saving the driver code, Create a virtual device and change it to the code then fill in the properties and you should be good to go.

I suppose this a reasonable thing to do.

So what if the outage exceeds the hold up time?
And I then there is the constant lead acid battery issues with APC.

Is there a consensus Li-Ion battery bank solution?

You can also point the NTP Device to an Internet based NTP Time server, I believe. You’ll need to figure out the IP address, though.

1 Like

Wait - how often have you encountered this?

Genuinely curious, because I've had APC UPS units dating back to the early '90s, and I've never had a lead acid battery in an APC UPS leak on me.

I've had batteries lose their capacity to retain a charge and have replaced them when that happens. I have an APC unit at work that dates back to December 1999, and have replaced the batteries in there probably 2 or 3 times. And even that old behemoth remains compatible with apcupsd.

Then, you have to make sure that your Hubitat hub is rebooted after the other devices come back online. No real way around a long-lasting power outage, except a whole home automatic backup generator.

1 Like

Good point. Also, this is a good reason to use some method of detecting power outages so the Hubitat (and other devices) can be shut down gracefully before backup power runs out.

Hence my use of apcupsd ...

1 Like

Almost every week where I work, with 80-100 rack-mounted units scattered around the facility in every wiring closet. I just received a new alarm overnight for another APC unit that failed its bi-weekly self-test with less than 2 years on the batteries.

Ever since Schneider took over, APC has definitely jumped the shark.....

2 Likes

Agreed. I refuse to buy APC at work for this same reason.

S.

1 Like

Nice idea.

I have a GPS-disciplined stratum 1 NTP server on my LAN that provides NTP services to the house regardless of Internet status. I'd like to see this as well.

Regards,

Don

At one point, I pleaded to convert all of the edge closets to equipment that could run on DC from telco-style battery piles to get away from APC. I had one blow me across the room as it threw a plasma-type arc bubble out of the front panel while I was trying to turn it on, with no emergency battery disconnect to shut it down while it went "China Syndrome" other than using a screwdriver to remove the front panel to pull the battery plugs inside the melting down unit! Needless to say, there is no APC in my house.

Also, one "bit" me a few years back while handling the battery pack:

The only good thing about this is that the electrical burn self-cauterized, with no blood lost and no infection.....

You can use @dan.t's NTP client that installs as a driver to set the time on your HE from your own NTPd.

Looks like this:

I force an update via NR once a day.

2 Likes

Wow, great! Will try it tonight!

Don

1 Like

Ouch!

S.

1 Like

GOOD LORD!!! You developers are AWESOME!! I have never seen this type of support for a device!! I run my own NTP server at home and this was one of my biggest gripes from any other home automation setup, there was no customization of NTP. It would check either a world clock or their own internal clock. Again, Thank you so much for paying so close attention to your community forum for feature requests!!

3 Likes

Wow, this works perfectly!

I have a Stratum 1 GPS disciplined NTP serve on the local LAN. It's actually part of a lightning detection network that use nanosecond-level accuracy GPS time to measure the arrival time of detected lighting strikes all over the world and triangulate those with detected events from other stations. The local NTP is an added feature of the unit.

The unit use the PPS rising edge signal to get the nanosecond-level accuracy. This NTP code can't do that, but even with the local delays in the LAN and devices, I'm getting 35 ms difference between NTP and Hubitat time.

NTP_Server

Great job and many thanks!

3 Likes

OK so I am new to this...

So I save the code as text file somewhere, then create a virtual device, and 'change it to the code' does that mean paste the code into the device somehow? I will play around with this, but it's not that clear to me (yet) I mean I could always rtfm right?

Never said leak. But I would prefer at this point in consumer energy storage to move to Li-Ion. Wait-what? Did I say that? Talk about little fires everywhere.

At work (power electronics / industrial) Schneider's Li-Ion rack based UPS is pretty impressive - with ModbusTCP built in. But it's a bit pricey for home use. What is more I need UPS at several places, for RPis, NASs, and a DVR backend, and now the Hubitat. I ordered (4) yesterday - and reading the reviews it seems like a crap shoot.

1 Like

To be clear, the great job was by @dan.t - he wrote the NTP client. I just linked to it in this thread.

1 Like

OK I rtfm'd. Virtual Device is in the Hub
Need to setup an ntp server - think I'll use the pvr backend windoze box for that.

Thanks much Hubitat denizens.

1 Like